﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;

namespace ASG.CodeGenerator.SQL
{
    public abstract class DBMServerCode<DatabaseType, ConnectionType, TableType, ColumnType, ProcedureType, ProcedureParameterType, ParameterType> : ASG.CodeGenerator.Core.Code
        where DatabaseType : DatabaseCode<TableType, ColumnType, ProcedureType, ProcedureParameterType, ParameterType>, new()
        where ConnectionType : DbConnection
        where TableType : TableCode<ColumnType, ParameterType>
        where ColumnType : ColumnCode<ParameterType>
        where ProcedureType : ProcedureCode<ProcedureParameterType, ParameterType>
        where ProcedureParameterType : ParameterCode<ParameterType>
        where ParameterType : DbParameter
    {
        private string _Name;

        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }

        private DBMServersTypes _Type;

        public DBMServersTypes Type
        {
            get { return _Type; }
            set { _Type = value; }
        }

        private string _Version;

        public string Version
        {
            get { return _Version; }
            set { _Version = value; }
        }

        public DBMServerCode(DBMServersTypes type)
        {
            _Type = type;
        }

        public abstract List<DatabaseType> GetDatabasesInfo(IDBMServerCredentials<ConnectionType> credentials);
    }
}
